package com.goal.struggle.web.goal;

import com.goal.struggle.common.base.Result;
import com.goal.struggle.model.vo.goal.GoalDailyVO;
import com.goal.struggle.service.goal.GoalDailyService;
import com.goal.struggle.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
public class GoalDailyController extends BaseController {
    @Autowired
    private GoalDailyService goalDailyService;

    @GetMapping("/goal/get/user/goal_daily")
    public Result<List<GoalDailyVO>> getGoalDailyByUserId(){
        Integer userId = getCurrentUser().getUserId();
        List<GoalDailyVO> goalDailyVOS = goalDailyService.getGoalDailyByUserId(userId);
        return Result.ok(goalDailyVOS);
    }

}
